package ua.kpi.javatraining.university;

/**
 * Person is the base class for human component of university.
 * Provides implementation of basic getters and setters.
 * A Person object encapsulates the state information needed
 * to describe every employee or student of university.
 *
 * @author Vasily Yatsenko
 * @version 1.1
 */
public class Person {
    private final Name name;
    private final Origin origin;
    private Contacts contacts;

    public Person(Contacts contacts, Origin origin, Name name) {
        this.contacts = contacts;
        this.origin = origin;
        this.name = name;
    }

    public Contacts getContacts() {
        return contacts;
    }

    public Name getName() {
        return name;
    }

    public Origin getOrigin() {
        return origin;
    }

    public String toString() {
        StringBuilder builder = new StringBuilder();

        builder.append(getName());
        builder.append(". ");
        builder.append(getOrigin());
        builder.append(". ");
        builder.append(getContacts());
        builder.append(". ");
        return builder.toString();
    }
}
